#!/usr/bin/python

##
## Copyright (C) 2010 Luciano Xumerle <luciano.xumerle@gmail.com>
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##

import time
import sys


def main():
   """main routine"""

   # pars
   errorMsg="SYNTAX: " + sys.argv[0] + " <solexa1.txt> [solexa2.txt]\n"

   solexa1=""
   solexa2=""
   paired=False

   if len(sys.argv)==2:
       solexa1=sys.argv[1]

   if len(sys.argv)==3:
       solexa1=sys.argv[1]
       solexa2=sys.argv[2]
       paired=True

   solexa1=open(solexa1)
   if paired:
       solexa2=open(solexa2)

   counter=0
   for line in solexa1:
       counter += 1
       sol1=line.strip()
       sol2=""
       if paired:
           sol2=solexa2.readline().strip()
       if counter == 1:
           print( ">"+ sol1[1:len(sol1)-2] )
       if counter == 2:
           print(sol1)
           if paired:
               print(sol2)
       if counter == 4:
           counter=0

if __name__=='__main__': main()

